/**
* This file is part of mobileworks.
*
* mobileworks is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* You should have received a copy of the GNU General Public License
* along with dev.clipall.  If not, see <http://www.gnu.org/licenses/>.
*
* https://code.google.com/p/mobileworks/
*/

/*
 * StringArray.java
 * Created on May 2, 2008, 11:43 PM
 */

package utils;

/**
 *
 * @author Erol Hira
 */
public class DataArray {
    
    private byte[] data;
    private int[] offsets;
    private short[] lengths;
    
    public DataArray(byte[] data, int[] offsets, short[] lengths) {
        this.data = data;
        this.offsets = offsets;
        this.lengths = lengths;
    }
    
    public byte[] get(int index){
        byte[] bytes = new byte[lengths[index]];
        return Util.subArrayOf(data, offsets[index], lengths[index]);        
    }
}
